package com.example.qiao.adapter;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.qiao.R;
import com.example.qiao.bean.Tong;

import java.util.List;

public class TongAdapter extends BaseQuickAdapter<Tong, BaseViewHolder> {
    public TongAdapter(int layoutResId, @Nullable List<Tong> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Tong item) {
        Glide.with(mContext).load(item.getCoverImg())
                .apply(RequestOptions.placeholderOf(R.drawable.a6))
                .apply(RequestOptions.errorOf(R.drawable.a6))
                .into((ImageView)helper.getView(R.id.iv));
    }
}
